package com.cal.utms.model.maintenance;

import java.util.ArrayList;
import java.util.List;

import com.cal.utms.dao.maintenance.DealTypeDao;
import com.cal.utms.dto.maintenance.DealTypeDto;
import com.cal.utms.entity.DealType;

public class DealTypeModel {

	DealTypeDao dao = new DealTypeDao();

	public List<DealTypeDto> getRolloverDealtype() {
		List<DealTypeDto> dealTypeDtos = new ArrayList<DealTypeDto>();
		List<DealType> dealTypes = dao.getRollOverDealType();
		for (DealType dealType : dealTypes) {
			DealTypeDto dto = new DealTypeDto();
			dto.setCode(dealType.getCode());
			dto.setDealType(dealType.getDealType());
			dto.setDescription(dealType.getDescription());
			dto.setId(dealType.getId());
			dto.setRollover(dealType.getRollover());
			dto.setShortMaturity(dealType.getShortMaturity());
			dealTypeDtos.add(dto);
		}
		return dealTypeDtos;
	}

}
